home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 11 Learning / 04 Mommersteeg / Tennis / Gamer.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-09-23  |  1.4 KB  |  44 lines

  1. //----------------------------------------------------------------------------------------------
  2. // Sequential Prediction Demo: The positioning pattern
  3. // 
  4. // Author:  Fri Mommersteeg
  5. // Date:    10-09-2001
  6. // File:    Gamer.h
  7. //----------------------------------------------------------------------------------------------
  8.  
  9. #ifndef __GAMER_H
  10. #define __GAMER_H
  11.  
  12. //----------------------------------------------------------------------------------------------
  13. // Include files
  14. //----------------------------------------------------------------------------------------------
  15.  
  16. #include "paddle.h"
  17.  
  18. //----------------------------------------------------------------------------------------------
  19. // Macro definitions
  20. //----------------------------------------------------------------------------------------------
  21.  
  22. #define KEY_DOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
  23. #define KEY_UP(vk_code)   ((GetAsyncKeyState(vk_code) & 0x8000) ? 0 : 1)
  24. #define VK_Z            0x5A
  25. #define VK_X            0x58
  26.  
  27. //----------------------------------------------------------------------------------------------
  28. // CGamer: A paddle controlled by human player input (keyboard)
  29. //----------------------------------------------------------------------------------------------
  30.  
  31. class CGamer : public CPaddle {
  32. public:
  33.  
  34.     virtual void        Update();
  35.  
  36. protected:
  37.  
  38.     void                HandleUserInput();
  39.  
  40. };
  41.  
  42. #endif // __GAMER_H
  43.  
  44.